﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="air_log.aspx.cs" Inherits="EZCRS.HCMS.Web.manage.AIR.air_log" %>

<%@ Register Src="../usercontrol/titlepage.ascx" TagName="titlepage" TagPrefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Air Log</title>
    <script src="../../common/jquery-1.2.6.min.js"></script>
    <script src="../../common/jquery-impromptu.1.5.js"></script>
    <script src="../../common/flexigrid/flexigrid.js"></script>
    <script src="../../common/winbox.js"></script>
    <link rel="stylesheet" href="../../common/flexigrid/flexigrid.css" type="text/css"
        media="screen" />
    <link rel="stylesheet" href="../../style/dfbDialog.css" type="text/css" media="screen" />
</head>
<body>

    <script type="text/javascript" charset="utf-8">
	
		$(document).ready(function(){
		
		    $('#grid').flexigrid({
		        //width: $(document).width() - 10,
		        height: 400,
		        //striped:false,		        
		        url:'?action=get',		        
		        dataType: 'json',  		        
		        colModel: [
		            {display: '编号', name : 'id', width : 100, sortable : false, align: 'left'}, 
                    {display: '计划级别', name : 'lev', width : 100, sortable : false, align: 'left'},   
                    {display: '房态', name : 'state', width : 100, sortable : false, align: 'left'},   
                    {display: '起始日期', name : 'start', width : 80, sortable : false, align: 'left'},   
                    {display: '结束日期', name : 'end', width : 80, sortable : false, align: 'left'},
                    {display: '操作人', name : 'oper', width : 100, sortable : false, align: 'left'},
                    {display: '创建日期', name : 'create', width : 180, sortable : false, align: 'left'}
                ],
                
                singleSelect: true,
                
                buttons : [   
                    { name: '<%= Resources.Site.CreateRateChangedNotify %>', bclass:"add", onpress: doCommand},
                    { separator: true}   
                ],  
                
                showTableToggleBtn: true,
                rp: 15,
                usepager: true,
                useRp: true,
                onSuccess: function(){ onDoubleClick(); }
                
		    });
		    
		});
		
		
	    function onDoubleClick()
        {
            $('#grid tbody tr td').each(function() {
            
                $(this).dblclick(function(e) {                
                    var row = $(this).parents('tr');                    
                    var id = row.children('td').eq(0).children('div').get(0).innerHTML;                    
                    ShowBox('air_log_detail.aspx?id=' + id, 450);
                });
            });
            
        }
		
		function doCommand(com, grid){
		
            if($('.trSelected', grid)[0] == null) {            
                alert('<%= Resources.Site.NoItemSelected %>');
                return;
            }
                
            var rowid = $('.trSelected', grid)[0].id.replace(/row/,"");                
            if (com == '<%= Resources.Site.CreateRateChangedNotify %>'){                   
                if(rowid != ''){
                    window.location = 'add_notify.aspx?id=' + rowid;
                }  
                
            }              
        }
        
                
        function doRefresh(){
            $('#grid').flexOptions().flexReload();
        }
         
    </script>

    <form id="form1" runat="server">
    <uc2:titlepage ID="Titlepage1" runat="server" inittitle="<%$ Resources:Site, AIRLog %>">
    </uc2:titlepage>

    </form>
    <table id="grid">
    </table>
    <div id="loadinfo" align="center">
    </div>
</body>
</html>
